package com.arox.springinaction.post;

import javax.jms.Destination;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jms.core.JmsTemplate;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

@Service("frontDeskTemplate")
public class FrontDeskTemplateImpl implements FrontDesk {

    @Autowired
    private JmsTemplate jmsTemplate;
    @Autowired
    private Destination destination;

    @Transactional
    public void sendMail(final Mail mail) {
	jmsTemplate.convertAndSend(destination, mail);
    }

}
